package tech.eyao.hs60x.enums;

/**
 * 类ExceptionCodeEnum.java的实现描述：统一系统CODE封装
 * 
 * @author fengjianchao 2018年1月29日 下午12:09:30
 */
public enum ExceptionCodeEnum {
    //业务操作
    ERROR_PARAMERROR(-101, "入参有误!"),
    INVALID_PARAMETER(-102, "参数非法，请检查！"),
    BIND_NOT_EXIST(-103, "绑定关系不存在！"),
    RECORD_EXISTS(-104, "对应记录已存在"),
    RECORD_NOT_EXISTS(-105, "对应记录不存在"),
    FILEUPLOAD_EXCEPTION(-106, "文件上传失败"),
    OBJECT_IS_NULL(-107, "对象不能为空"),
    //数据源操作
    DELETE_EXCEPTION(-201, "删除异常"),
    UPDATE_EXCEPTION(-202, "更新异常"),
    INSERT_EXCEPTION(-203, "插入异常"),
    SELECT_EXCEPTION(-204, "查询异常"),

    //登录相关TOKEN
    TOKEN_EXPIRE(-301, "TOKEN已过期!"),
    TOKEN_PARAMERROR_NULL(-302, "TOKEN为空!"),

    //历来有个故事是给999
    SYSTEM_EXCEPTION(999, "系统异常请稍后重试！");

    private int    code;
    private String message;

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    private ExceptionCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
}
